import java.util.Scanner;

public class score {
    //需求：
    //在唱歌比赛中，有6名评委给选手打分，分数范围是[0- 100]之间的整数。
    // 选手的最后得分为：去掉最高分、最低分后的4个评委的平均分，请完成上述过程并计算出选手的得分。
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int score[] = new int[6];
        int flag = 1;
        for (int i = 0; i < score.length; ) {
            System.out.println("请输入第" + flag + "个评委的分数"+"(0~100)");
            int number = sc.nextInt();
            if (number>=0&&number<=100){
                score[i] = number;
                flag++;
                i++;
            }else{
                System.out.println("输的什么逼玩意,重新输");
            }

        }
        int maxScore = score[1];
        int minScore = score[1];
        for (int i = 0; i < score.length; i++) {
            if (minScore >= score[i]) {
                minScore = score[i];
            }
        }
        for (int i = 0; i < score.length; i++) {
            if (maxScore <= score[i]) {
                maxScore = score[i];
            }
        }
        for (int i = 0; i < score.length; i++) {
            if (maxScore == score[i]) {
                score[i] -= maxScore;
            }
        }
        for (int i = 0; i < score.length; i++) {
            if (minScore == score[i]) {
                score[i] -= minScore;
            }
        }
        for (int i = 0; i < score.length; i++) {
            System.out.println(score[i]);
        }
        int average = 0;
        for (int i = 0; i < score.length; i++) {
            average += score[i];
        }
        average = average / 6;
        System.out.println("本次裁判打分的平均值为:" + average);
    }

}



